/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * IFMunicipios.java
 *
 * Created on 06/02/2012, 08:58:27
 */
package gui.frames.internos;

import controle.gui.frames.internos.ControleBoletinsPendentes;
import controle.gui.superclasses.InternalFrame;
import controle.gui.utils.ComboBoxUtils;
import gui.componentes.JTextFieldCodigo;
import gui.componentes.MascarasJTextField;
import javax.swing.JFormattedTextField;

/**
 * Frame interno para gerenciamento de Localidades e Croquis
 *
 * @author Maycon Fernando Silva Brito
 * @author mayconfsbrito@gmail.com
 */
public class IFBoletinsPendentes extends InternalFrame {

    /*
     * Variáveis da classe
     */
    private ControleBoletinsPendentes controle = new ControleBoletinsPendentes(this);
    public SelectionListener listener;

    /*
     * Creates new form IFMunicipios
     */
    public IFBoletinsPendentes() {
        initComponents();
        this.listener = new SelectionListener(this.tabela);
        this.inicializa();
    }

    @Override
    protected void inicializa() {
        controle.inicializa();
    }

    @Override
    protected void limparGUI() {
        controle.limparGUI();
    }

    @Override
    protected void tabelaPreencheGUI() {
        controle.tabelaPreencheGUI(this.tabela);
    }

    /**
     * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the
     * Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        groupAtv = new javax.swing.ButtonGroup();
        groupCategoria = new javax.swing.ButtonGroup();
        panelLocalidades = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tabela = new javax.swing.JTable();
        panelBusca = new javax.swing.JPanel();
        labelBuscaData = new javax.swing.JLabel();
        buttonBuscar = new javax.swing.JButton();
        buttonLimparBusca = new javax.swing.JButton();
        textBuscaData = new javax.swing.JFormattedTextField(new MascarasJTextField().inserirMascara("##/##/####"));
        ((JFormattedTextField)textBuscaData).setFocusLostBehavior(JFormattedTextField.COMMIT);
        labelBuscaIdAgente = new javax.swing.JLabel();
        textBuscaCodigoAgente = new JTextFieldCodigo(3, true);
        labelBuscaMunicipio = new javax.swing.JLabel();
        textBuscaCodigoMunicipio = new JTextFieldCodigo(7, true);
        textBuscaNomeMunicipio = new javax.swing.JTextField();
        labelBuscaLocalidade = new javax.swing.JLabel();
        textBuscaCodigoLocalidade = new JTextFieldCodigo(4, false);
        comboBuscaLocalidade = new javax.swing.JComboBox();
        comboBuscaAgente = new javax.swing.JComboBox();
        labelBuscaData1 = new javax.swing.JLabel();
        textBuscaId = new JTextFieldCodigo(8, false);
        jLabel1 = new javax.swing.JLabel();
        textNumBoletinsPendentes = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        panelOpcoes = new javax.swing.JPanel();
        buttonCancelar = new javax.swing.JButton();
        buttonAlterar = new javax.swing.JButton();
        buttonLimpar = new javax.swing.JButton();
        panelVisitas1 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tabelaVisitas = new javax.swing.JTable();
        jPanel3 = new javax.swing.JPanel();
        textNLarvasAEG = new JTextFieldCodigo(2, true);
        labelAEG = new javax.swing.JLabel();
        labelALB = new javax.swing.JLabel();
        textNLarvasALB = new JTextFieldCodigo(2, true);
        labelOUT = new javax.swing.JLabel();
        textNLarvasOUT = new JTextFieldCodigo(2, true);

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setTitle("Laboratório - Boletins de Pesquisa com Visitas Pendentes");
        setMaximumSize(null);
        setMinimumSize(new java.awt.Dimension(870, 700));
        setPreferredSize(new java.awt.Dimension(870, 700));

        panelLocalidades.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Boletins Pendentes", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        tabela.setAutoCreateRowSorter(true);
        tabela.setFont(new java.awt.Font("DejaVu Sans", 0, 11)); // NOI18N
        tabela.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id", "Data", "Municipio", "Localidade", "Agente"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(tabela);

        panelBusca.setBorder(javax.swing.BorderFactory.createTitledBorder("Busca"));

        labelBuscaData.setText("Data:");

        buttonBuscar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Buscar.png"))); // NOI18N
        buttonBuscar.setText("Buscar");
        buttonBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonBuscarActionPerformed(evt);
            }
        });

        buttonLimparBusca.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Limpar.png"))); // NOI18N
        buttonLimparBusca.setText("Limpar Busca");
        buttonLimparBusca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonLimparBuscaActionPerformed(evt);
            }
        });

        ((JFormattedTextField)textBuscaData).setHorizontalAlignment(textBuscaData.LEFT);
        textBuscaData.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textBuscaDataActionPerformed(evt);
            }
        });

        labelBuscaIdAgente.setText("Agente:>");

        textBuscaCodigoAgente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textBuscaCodigoAgenteActionPerformed(evt);
            }
        });

        labelBuscaMunicipio.setText("Município:>");

        textBuscaCodigoMunicipio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textBuscaCodigoMunicipioActionPerformed(evt);
            }
        });

        textBuscaNomeMunicipio.setEnabled(false);
        textBuscaNomeMunicipio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textBuscaNomeMunicipioActionPerformed(evt);
            }
        });

        labelBuscaLocalidade.setText("Localidade:>");

        textBuscaCodigoLocalidade.setEnabled(false);
        textBuscaCodigoLocalidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textBuscaCodigoLocalidadeActionPerformed(evt);
            }
        });

        comboBuscaLocalidade.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione..." }));
        comboBuscaLocalidade.setEnabled(false);
        comboBuscaLocalidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboBuscaLocalidadeActionPerformed(evt);
            }
        });

        comboBuscaAgente.setModel(ComboBoxUtils.inicializaComboBoxEntidades("Selecione...", "Agente WHERE idAgente!=1", "nome"));
        comboBuscaAgente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboBuscaAgenteActionPerformed(evt);
            }
        });

        labelBuscaData1.setText("Id Boletim:");

        ((JFormattedTextField)textBuscaData).setHorizontalAlignment(textBuscaData.LEFT);
        textBuscaId.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textBuscaIdActionPerformed(evt);
            }
        });

        jLabel1.setText("Ainda existem um total de");

        textNumBoletinsPendentes.setEnabled(false);

        jLabel2.setText("boletim(ns) pendente(s) no sistema.");

        javax.swing.GroupLayout panelBuscaLayout = new javax.swing.GroupLayout(panelBusca);
        panelBusca.setLayout(panelBuscaLayout);
        panelBuscaLayout.setHorizontalGroup(
            panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBuscaLayout.createSequentialGroup()
                .addComponent(buttonBuscar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonLimparBusca)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(textNumBoletinsPendentes, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addContainerGap(123, Short.MAX_VALUE))
            .addGroup(panelBuscaLayout.createSequentialGroup()
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(labelBuscaLocalidade)
                    .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(labelBuscaData1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(labelBuscaMunicipio, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(textBuscaId, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(textBuscaCodigoLocalidade)
                        .addComponent(textBuscaCodigoMunicipio, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelBuscaLayout.createSequentialGroup()
                        .addComponent(labelBuscaData)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(textBuscaData, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(labelBuscaIdAgente)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(textBuscaCodigoAgente, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboBuscaAgente, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(textBuscaNomeMunicipio)
                    .addComponent(comboBuscaLocalidade, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        panelBuscaLayout.setVerticalGroup(
            panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBuscaLayout.createSequentialGroup()
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textBuscaCodigoAgente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelBuscaIdAgente)
                    .addComponent(textBuscaData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelBuscaData)
                    .addComponent(comboBuscaAgente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textBuscaId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelBuscaData1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelBuscaMunicipio)
                    .addComponent(textBuscaNomeMunicipio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textBuscaCodigoMunicipio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelBuscaLocalidade)
                    .addComponent(comboBuscaLocalidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textBuscaCodigoLocalidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(textNumBoletinsPendentes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel2))
                    .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(buttonBuscar)
                        .addComponent(buttonLimparBusca))))
        );

        javax.swing.GroupLayout panelLocalidadesLayout = new javax.swing.GroupLayout(panelLocalidades);
        panelLocalidades.setLayout(panelLocalidadesLayout);
        panelLocalidadesLayout.setHorizontalGroup(
            panelLocalidadesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1)
            .addComponent(panelBusca, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        panelLocalidadesLayout.setVerticalGroup(
            panelLocalidadesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelLocalidadesLayout.createSequentialGroup()
                .addComponent(panelBusca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
                .addGap(0, 0, 0))
        );

        panelOpcoes.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Opções", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        buttonCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Cancelar.png"))); // NOI18N
        buttonCancelar.setText("Cancelar");
        buttonCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonCancelarActionPerformed(evt);
            }
        });

        buttonAlterar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Alterar.png"))); // NOI18N
        buttonAlterar.setText("Alterar");
        buttonAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonAlterarActionPerformed(evt);
            }
        });

        buttonLimpar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Novo.png"))); // NOI18N
        buttonLimpar.setText("Limpar");
        buttonLimpar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonLimparActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelOpcoesLayout = new javax.swing.GroupLayout(panelOpcoes);
        panelOpcoes.setLayout(panelOpcoesLayout);
        panelOpcoesLayout.setHorizontalGroup(
            panelOpcoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelOpcoesLayout.createSequentialGroup()
                .addComponent(buttonAlterar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonLimpar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonCancelar)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        panelOpcoesLayout.setVerticalGroup(
            panelOpcoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelOpcoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(buttonLimpar)
                .addComponent(buttonCancelar))
            .addComponent(buttonAlterar)
        );

        panelVisitas1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Visitas Pendentes", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        tabelaVisitas.setFont(new java.awt.Font("DejaVu Sans", 0, 11)); // NOI18N
        tabelaVisitas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id", "Hora", "Quadra", "Logradouro", "Imovel", "Complemento", "Tub. Colet.", "Nº Amost.", "Aeg", "Alb", "Out"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Object.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabelaVisitas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelaVisitasMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(tabelaVisitas);

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Número de Larvas:"));

        labelAEG.setText("AEG:");

        labelALB.setText("ALB:");

        labelOUT.setText("OUT:");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(labelAEG)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(textNLarvasAEG, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(labelALB)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(textNLarvasALB, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(labelOUT)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(textNLarvasOUT, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(labelOUT)
                .addComponent(textNLarvasOUT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(labelALB)
                .addComponent(textNLarvasALB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(labelAEG)
                .addComponent(textNLarvasAEG, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout panelVisitas1Layout = new javax.swing.GroupLayout(panelVisitas1);
        panelVisitas1.setLayout(panelVisitas1Layout);
        panelVisitas1Layout.setHorizontalGroup(
            panelVisitas1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 763, Short.MAX_VALUE)
            .addGroup(panelVisitas1Layout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        panelVisitas1Layout.setVerticalGroup(
            panelVisitas1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelVisitas1Layout.createSequentialGroup()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelOpcoes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(panelLocalidades, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(panelVisitas1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(panelLocalidades, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelVisitas1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelOpcoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void buttonAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAlterarActionPerformed
        controle.alterar();
    }//GEN-LAST:event_buttonAlterarActionPerformed

    private void buttonBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonBuscarActionPerformed
        controle.buscar();
    }//GEN-LAST:event_buttonBuscarActionPerformed

    private void buttonLimparBuscaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonLimparBuscaActionPerformed
        controle.limparBusca();
    }//GEN-LAST:event_buttonLimparBuscaActionPerformed

    private void textBuscaCodigoAgenteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textBuscaCodigoAgenteActionPerformed
        controle.eventoTextCodigoAgentes(textBuscaCodigoAgente, comboBuscaAgente, true);
    }//GEN-LAST:event_textBuscaCodigoAgenteActionPerformed

    private void textBuscaCodigoMunicipioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textBuscaCodigoMunicipioActionPerformed
        controle.eventoTextCodigoMunicipio(this.textBuscaCodigoLocalidade, this.comboBuscaLocalidade, this.textBuscaCodigoMunicipio, this.textBuscaNomeMunicipio);
    }//GEN-LAST:event_textBuscaCodigoMunicipioActionPerformed

    private void textBuscaCodigoLocalidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textBuscaCodigoLocalidadeActionPerformed
        controle.eventoTextCodigoLocalidade(this.textBuscaCodigoLocalidade, this.comboBuscaLocalidade, this.textBuscaCodigoMunicipio, null);
    }//GEN-LAST:event_textBuscaCodigoLocalidadeActionPerformed

    private void comboBuscaLocalidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboBuscaLocalidadeActionPerformed
        controle.eventoComboLocalidade(this.textBuscaCodigoLocalidade, this.comboBuscaLocalidade, this.textBuscaCodigoMunicipio, null, null, null);
    }//GEN-LAST:event_comboBuscaLocalidadeActionPerformed

    private void comboBuscaAgenteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboBuscaAgenteActionPerformed
        controle.eventoComboAgentes(this.comboBuscaAgente, textBuscaCodigoAgente);
    }//GEN-LAST:event_comboBuscaAgenteActionPerformed

    private void textBuscaNomeMunicipioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textBuscaNomeMunicipioActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_textBuscaNomeMunicipioActionPerformed

    private void textBuscaDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textBuscaDataActionPerformed
        controle.buscar();
    }//GEN-LAST:event_textBuscaDataActionPerformed

    private void tabelaVisitasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaVisitasMouseClicked
        controle.consultaTabelaVisitas(evt);
    }//GEN-LAST:event_tabelaVisitasMouseClicked

    private void textBuscaIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textBuscaIdActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_textBuscaIdActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JButton buttonAlterar;
    public javax.swing.JButton buttonBuscar;
    public javax.swing.JButton buttonCancelar;
    public javax.swing.JButton buttonLimpar;
    public javax.swing.JButton buttonLimparBusca;
    public javax.swing.JComboBox comboBuscaAgente;
    public javax.swing.JComboBox comboBuscaLocalidade;
    public javax.swing.ButtonGroup groupAtv;
    private javax.swing.ButtonGroup groupCategoria;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JLabel labelAEG;
    private javax.swing.JLabel labelALB;
    private javax.swing.JLabel labelBuscaData;
    private javax.swing.JLabel labelBuscaData1;
    private javax.swing.JLabel labelBuscaIdAgente;
    private javax.swing.JLabel labelBuscaLocalidade;
    private javax.swing.JLabel labelBuscaMunicipio;
    private javax.swing.JLabel labelOUT;
    private javax.swing.JPanel panelBusca;
    private javax.swing.JPanel panelLocalidades;
    private javax.swing.JPanel panelOpcoes;
    private javax.swing.JPanel panelVisitas1;
    public javax.swing.JTable tabela;
    public javax.swing.JTable tabelaVisitas;
    public javax.swing.JTextField textBuscaCodigoAgente;
    public javax.swing.JTextField textBuscaCodigoLocalidade;
    public javax.swing.JTextField textBuscaCodigoMunicipio;
    public javax.swing.JTextField textBuscaData;
    public javax.swing.JTextField textBuscaId;
    public javax.swing.JTextField textBuscaNomeMunicipio;
    public javax.swing.JTextField textNLarvasAEG;
    public javax.swing.JTextField textNLarvasALB;
    public javax.swing.JTextField textNLarvasOUT;
    public javax.swing.JTextField textNumBoletinsPendentes;
    // End of variables declaration//GEN-END:variables
}
